﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp1
{
    public partial class ServerItemControl : UserControl
    {
        public ServerItemControl()
        {
            InitializeComponent();
        }

        CheckState checkState = CheckState.Unchecked;
        private void ServerCheckBox_CheckedChanged(object sender, EventArgs e)
        {
            this.checkState = this.ServerCheckBox.CheckState;
        }

        public CheckState GetCheckState()
        {
            return this.checkState;
        }

        public string GetServerName()
        {
            return this.ServerItemName.Text;
        }

        public void Init(string serverName = "", bool fugai = false)
        {
            this.ServerItemName.Text = serverName;
            this.ServerCheckBox.CheckState = fugai ? CheckState.Checked : CheckState.Unchecked;
        }

        private void ServerItemControl_Load(object sender, EventArgs e)
        {

        }
    }
}
